Storage systems typically arrange not only data, but also metadata, into blocks of storage. For example, a file in a file system has an inode stored in a block of storage of a storage system that points to other blocks of the storage system in which data belonging to the file reside.
Such storage systems may use a transaction log to record changes to metadata. A transaction log is a log stored in non-volatile memory (e.g., on disk) which is used to preserve and protect metadata changes, thus preventing associated data from being corrupted. For example, a command from a file system, such as to create a file, is accompanied by a sequence of metadata changes. Suppose that, in the midst of executing the file system command, there is a system panic and the storage system shuts down, having processed only a fraction of the metadata changes accompanying the file system command. In this case, without a record of the metadata changes that were supposed to have been implemented, the storage system is left with potentially inconsistent metadata, which may lead to corruption of corresponding data. By recording the metadata changes in a transaction log, however, the storage system can go back to the transaction log to recover the metadata changes that were not implemented prior to the shutdown and implement them.
When the storage system identifies a set of individual metadata change instructions accompanying a file system command, a conventional approach to populating the transaction log has the storage system expressing each metadata change instruction in terms of a standard syntax that identifies a piece of metadata and the state of that piece of metadata after the change instruction.